(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    ["pages/main/sales/orderDetails"], {
        "0266": function (t, e, a) {
            "use strict";
            a.r(e);
            var n = a("1818"),
                o = a.n(n);
            for (var i in n)["default"].indexOf(i) < 0 && function (t) {
                a.d(e, t, (function () {
                    return n[t]
                }))
            }(i);
            e["default"] = o.a
        },
        1818: function (t, e, a) {
            "use strict";
            (function (t) {
                var n = a("4ea4");
                Object.defineProperty(e, "__esModule", {
                    value: !0
                }), e.default = void 0;
                var o = n(a("2eee")),
                    i = n(a("c973")),
                    s = (n(a("0436")), {
                        components: {
                            dtSelect: function () {
                                a.e("components/dt-select/dt-select").then(function () {
                                    return resolve(a("9fbf"))
                                }.bind(null, a)).catch(a.oe)
                            }
                        },
                        data: function () {
                            return {
                                ordernetWeight:0,
                                url: getApp().globalData.apiurl,
                                zzl: 0,
                                zje: 0,
                                fhsj: "",
                                ddid: "",
                                listData: [],
                                ds: [],
                                outsalesdocuments: [],
                                // startDate: getDate("start"),
                                // endDate: getDate("end"),
                                customers: [],
                                goods: [],
                                roles: [],
                                model: {
                                    id: 0,
                                    customerId: "",
                                    goodId: "",
                                    weight: "",
                                    unitPrice: "",
                                    totalPrice: 0,
                                    roleId: "",
                                    status: 0,
                                    deliverytime: null
                                },
                                finalList: [],
                                rules: {}
                            }
                        },
                        methods: {
                            initData: function (e) {
                                var a = this;
                                return (0, i.default)(o.default.mark((function n() {
                                    return o.default.wrap((function (n) {
                                        while (1) switch (n.prev = n.next) {
                                            case 0:
                                                a.listData = [], a, e > 0 && t.request({
                                                    url: a.url + "sale/product/list",
                                                    method: "GET",
                                                    data: {
                                                        orderid: e
                                                    },
                                                    success: function (n) {
                                                        console.log(n.data.rows);
                                                        a.listData = n.data.rows, t.request({
                                                            url: a.url + "outsalesdocuments/outsalesdocuments/list",
                                                            method: "GET",
                                                            data: {
                                                                salesdocumentsno: e
                                                            },
                                                            success: function (t) {
                                                                a.outsalesdocuments = t.data.rows;
                                                                let countWeight = 0 ;
                                                                a.ds.forEach(item=>{
                                                                    let index = a.outsalesdocuments.findIndex(otem => otem.licenseplate === item.item.licenseplate)
                                                                    if(index!=-1){
                                                                        console.log("进入",index)
                                                                        item.gbInfo = a.outsalesdocuments[index]
                                                                    }
                                                                    countWeight +=parseFloat( (item.gbInfo.netweight==undefined||item.gbInfo.netweight==null)?0:item.gbInfo.netweight);
                                                                });
                                                                a.ordernetWeight = countWeight
                                                                console.log("end",countWeight)
                                                                // a.outsalesdocuments.forEach(item => {
                                                                //     let index = a.ds.findIndex(dtem => dtem.licenseplate === item.licenseplate)
                                                                //     if (index != -1) {
                                                                //         console.log("得到对应的车辆信息");
                                                                //         console.log(a.ds[index])
                                                                //     }
                                                                // });
                                                                for (var e = 0; e < a.listData.length; e++)
                                                                    for (var n = 0; n < a.outsalesdocuments.length; n++) a.listData[e].goodsno == a.outsalesdocuments[n].maintaintime && (a.listData[e].netweight = a.outsalesdocuments[n].netweight, a.listData[e].hairweight = a.outsalesdocuments[n].hairweight, a.listData[e].skinweight = a.outsalesdocuments[n].skinweight)
                                                            },
                                                            fail: function () {},
                                                            complete: function () {}
                                                        }), t.request({
                                                            url: a.url + "goodsmaintain/goods/list",
                                                            method: "GET",
                                                            data: {
                                                                type: "2"
                                                            },
                                                            success: function (t) {
                                                                for (var e = t.data.rows, n = 0; n < a.listData.length; n++)
                                                                    for (var o = 0; o < e.length; o++) a.listData[n].goodsno == e[o].goodsno && (a.listData[n].remark = e[o].goodsname)
                                                            },
                                                            fail: function () {},
                                                            complete: function () {}
                                                        })
                                                    }
                                                });
                                            case 3:
                                            case "end":
                                                return n.stop()
                                        }
                                    }), n)
                                })))()
                            },
                            getMoney: function () {
                                var t = 0;
                                if (0 != this.listData.length) return this.listData.forEach((function (e) {
                                    t += parseInt(e.weight * e.unitprice)
                                })), t
                            },
                            getWeight: function () {
                                var t = 0;
                                if (0 != this.listData.length) return this.listData.forEach((function (e) {
                                    t += parseInt(e.weight)
                                })), t
                            }
                        },
                        onLoad: function (e) {
                            //  console.log("传参", e.id);
                            var a = this;
                            this.initData(parseInt(e.id));
                            // a.model.id = 0;
                            // a.model.customerId = "";
                            // a.model.goodId = "";
                            // this.model.weight = "";
                            // this.model.unitPrice = "";
                            // this.model.totalPrice = 0;
                            // this.model.roleId = "";
                            // this.model.status = 0;
                            // this.customers = [];
                            // this.goods = [];
                            e.id && (
                                t.request({
                                    url: this.url + "driverorders/driverorders/list",
                                    method: "GET",
                                    data: {
                                        orderid: e.id,
                                        ordertype: 2
                                    },
                                    success: function (t) {
                                        // console.log(t.data.rows), 
                                        t.data.rows.forEach(item=>{
                                            let con = {
                                                item,
                                                gbInfo:{}
                                            }    
                                            a.ds.push(con)    
                                        })
                                        // a.ds = t.data.rows
                                    },
                                    fail: function () {},
                                    complete: function () {}
                                }), t.setNavigationBarTitle({
                                    title: "销售单详情"
                                }), t.request({
                                    url: this.url + "salesdocuments/salesdocuments/".concat(e.id),
                                    method: "GET",
                                    data: {},
                                    success: function (t) {
                                        //  console.log(t.data.data),
                                        a.model.id = t.data.data.id, a.model.customerId = t.data.data.customerno, a.zzl = t.data.data.weight, a.zje = t.data.data.amountofmoney, a.model.unitPrice = t.data.data.unitprice, a.model.totalPrice = t.data.data.amountofmoney;
                                        var e = t.data.data.approver1,
                                            n = e.lastIndexOf(",");
                                        e = e.substring(0, n), a.model.roleId = e
                                    },
                                    fail: function () {},
                                    complete: function () {}
                                }))
                        }
                    });
                e.default = s
            }).call(this, a("543d")["default"])
        },
        "3ec6": function (t, e, a) {
            "use strict";
            a.r(e);
            var n = a("8de7"),
                o = a("0266");
            for (var i in o)["default"].indexOf(i) < 0 && function (t) {
                a.d(e, t, (function () {
                    return o[t]
                }))
            }(i);
            a("dc7e");
            var s = a("f0c5"),
                u = Object(s["a"])(o["default"], n["b"], n["c"], !1, null, "7a5afd24", null, !1, n["a"], void 0);
            e["default"] = u.exports
        },
        "48fb": function (t, e, a) {
            "use strict";
            (function (t, e) {
                var n = a("4ea4");
                a("c150"), a("5c17"), a("a9ff");
                n(a("66fd"));
                var o = n(a("3ec6"));
                t.__webpack_require_UNI_MP_PLUGIN__ = a, e(o.default)
            }).call(this, a("bc2e")["default"], a("543d")["createPage"])
        },
        "8de7": function (t, e, a) {
            "use strict";
            a.d(e, "b", (function () {
                return o
            })), a.d(e, "c", (function () {
                return i
            })), a.d(e, "a", (function () {
                return n
            }));
            var n = {
                    uniSwipeAction: function () {
                        return a.e("components/uni-swipe-action/uni-swipe-action").then(a.bind(null, "e7b4"))
                    },
                    uniSwipeActionItem: function () {
                        return Promise.all([a.e("common/vendor"), a.e("components/uni-swipe-action-item/uni-swipe-action-item")]).then(a.bind(null, "c498"))
                    }
                },
                o = function () {
                    var t = this.$createElement,
                        e = (this._self._c, this.outsalesdocuments.length);
                    this.$mp.data = Object.assign({}, {
                        $root: {
                            g0: e
                        }
                    })
                },
                i = []
        },
        dc7e: function (t, e, a) {
            "use strict";
            var n = a("ee25"),
                o = a.n(n);
            o.a
        },
        ee25: function (t, e, a) {}
    },
    [
        ["48fb", "common/runtime", "common/vendor"]
    ]
]);